#include "itemvieweditdialog.h"

void ItemViewEditDialog::setItem(ItemModel *item)
{
    this->nameEdit->setText(item->getName());
    this->codeEdit->setText(item->getCode());

    this->srpEdit->setText(QString::number(item->getSrp()));

    this->item = item;
}

ItemViewEditDialog::ItemViewEditDialog(QWidget *parent, ItemModel *item) :
   ItemViewAddDialog(parent)
{
    this->setWindowTitle("Edit Item");
    this->headerLabel->setText("Edit an Item");
    this->subHeaderLabel->setText("Modify your Item's details as needed.");

    this->setItem(item);
}
